import React from 'react';
import Link from 'umi/link';
import NavLink from 'umi/navlink';
/**
 * 布局组件
 */
export default ({children,location:{pathname}}) => {
  return (
   <React.Fragment>
        <nav className="navbar navbar-default">
            <div className="container-fluid">
                <div className="navbar-header">
                        <a className="navbar-brand">珠峰架构</a>
                    </div> 
                    <div>
                        <ul className="nav navbar-nav">
                            {/* <li className={pathname=="/"?'active':''}><Link to="/">首页</Link></li>
                            <li className={pathname=="/user"?'active':''}><Link to="/user">用户管理</Link></li>
                            <li className={pathname=="/profile"?'active':''}><Link to="/profile">个人中心</Link></li> */}
                            <li ><NavLink exact={true} to="/">首页</NavLink></li>
                            <li ><NavLink to="/user/list">用户管理</NavLink></li>
                            <li ><NavLink to="/admin">管理中心</NavLink></li>
                            <li ><NavLink to="/profile">个人中心</NavLink></li>
                        </ul>
                    </div>
            </div>
        </nav>  
        <div className="container">
            <div className="row">
                <div className="col-md-8 col-md-offset-2">
                {children}
                </div> 
            </div>
        </div>
   </React.Fragment>
  )
}
